import Vue from 'vue'
import VueI18n from 'vue-i18n'
import elZh from 'element-ui/lib/locale/lang/zh-CN'
import elEn from 'element-ui/lib/locale/lang/en'
import localZh from './zh'
import localEn from './en'
import jsCookie from 'js-cookie'

Vue.use(VueI18n)

const i18n = new VueI18n({
  locale: jsCookie.get('lang') || 'zh',
  messages: {
    zh: {
      ...elZh,
      ...localZh
    },
    en: {
      ...elEn,
      ...localEn
    }
  }
})

export default i18n
